package com.zp.framework.jpa;

import java.util.List;
import com.zp.util.MyException;

/**
 * define JPA interface for entity data operation
 * 
 * @author chenlijun08@gmail.com
 * 
 * @version 1.0
 * 
 * @date 2014/2/1
 * 
 */
public interface IJpaDao {

	public void clear() throws MyException;

	public void save(Object entity) throws MyException;

	public Object update(Object entity) throws MyException;

	public void deleteObject(Object entity) throws MyException;

	public void deleteById(Class<?> entityClass, Object id)throws MyException;

	public void deleteFromCriteria(String jpql, Object[] queryParam)throws MyException;

	public Object findById(Class<?> entityClass, Object id) throws MyException;

	public List<?> getResultData(Class<?> entityClass);

	public List<?> getResultData(final int pageNo, final int pageSize,final String jpql, final Object[] queryParams) throws MyException;

	public long getCount(final String jpql, final Object[] queryParams);

	public List<?> findByNativeQuery(final int pageNo, final int pageSize,final String sql, final Object[] queryParams);
}
